/**
 * Copyright &copy; 2015-2020 <a href="http://www.easyhis.com/">easyhis</a> All rights reserved.
 */
package com.easy.dfcapi.entity;

import com.easy.common.utils.IdGen;
import com.easy.common.utils.excel.annotation.ExcelField;
import com.easy.core.persistence.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 图库Entity
 * @author waylen chi
 * @version 2018-01-12
 */
public class ApiVideo extends BaseEntity<ApiVideo> {

	private static final long serialVersionUID = 1L;
	private Integer videoId;		// 编号
	private String id;		// UUID
	private Integer videoType;		// 图片类型
	private String videoLocalUrl;		// 本地URL
	private String videoUrl;		// 当前使用URL
	private String videoOssUrl;		// OSSURL
	private String videoCover;		// 当前使用URL
	private String videoLocalCover;		// 本地封面URL
	private String videoOssCover;		// OSS封面URL

	private Date createTime;		// 创建时间
	private ApiUser createBy;		// 创建者
	private Date updateTime;		// 更新时间
	private ApiUser updateBy;		// 更新者
	private String delFlag;		// 删除标志

	public ApiVideo() {
		super();
	}

	public ApiVideo(String id){
		this.id = id;
	}

	public Integer getVideoId() {
		return videoId;
	}

	public void setVideoId(Integer videoId) {
		this.videoId = videoId;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Integer getVideoType() {
		return videoType;
	}

	public void setVideoType(Integer videoType) {
		this.videoType = videoType;
	}

	public String getVideoLocalUrl() {
		return videoLocalUrl;
	}

	public void setVideoLocalUrl(String videoLocalUrl) {
		this.videoLocalUrl = videoLocalUrl;
	}

	public String getVideoUrl() {
		return videoUrl;
	}

	public void setVideoUrl(String videoUrl) {
		this.videoUrl = videoUrl;
	}

	public String getVideoOssUrl() {
		return videoOssUrl;
	}

	public void setVideoOssUrl(String videoOssUrl) {
		this.videoOssUrl = videoOssUrl;
	}

	public String getVideoCover() {
		return videoCover;
	}

	public void setVideoCover(String videoCover) {
		this.videoCover = videoCover;
	}

	public String getVideoLocalCover() {
		return videoLocalCover;
	}

	public void setVideoLocalCover(String videoLocalCover) {
		this.videoLocalCover = videoLocalCover;
	}

	public String getVideoOssCover() {
		return videoOssCover;
	}

	public void setVideoOssCover(String videoOssCover) {
		this.videoOssCover = videoOssCover;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public ApiUser getCreateBy() {
		return createBy;
	}

	public void setCreateBy(ApiUser createBy) {
		this.createBy = createBy;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public ApiUser getUpdateBy() {
		return updateBy;
	}

	public void setUpdateBy(ApiUser updateBy) {
		this.updateBy = updateBy;
	}

	public String getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}

	/**
	 * 插入之前执行方法，需要手动调用
	 */
	public void preInsert(){
		this.id = IdGen.uuid();

		this.updateTime = new Date();
		this.createTime = this.updateTime;
	}

	/**
	 * 更新之前执行方法，需要手动调用
	 */
	public void preUpdate(){
		this.updateTime = new Date();
	}
	/**
	 * 插入之前执行方法，需要手动调用
	 */
	public void preInsert(Date now){
		this.id = IdGen.uuid();

		this.updateTime = now;
		this.createTime = this.updateTime;
	}

	/**
	 * 更新之前执行方法，需要手动调用
	 */
	public void preUpdate(Date now){
		this.updateTime = now;
	}
}